package chapter10;

import java.util.Scanner;

public class Day06 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入斐波那契前几项：");
        int num = input.nextInt();
        int a =1,b=1,c;
        System.out.print("1,1,");
        for (int i = 3; i <=num; i++) {
            c = a+b;
            a = b;
            b = c;
            System.out.print(c+",");
        }
    }
}
